import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

/**
 * Created by Shine Kaye on 2016/10/18.
 */
public class Main {

    public static void main(String[] args) throws IOException {

        String src = "./images/thuglife.jpg";

        CutImageUtils.cutImage(src, "./images/", 0.5f, 0.5f);     //Cut the image in half height and half width
        ResizeImageUtils.enlarge(src, "./images/", 3, 2);         //Enlarge the image 3*height and 2*width
        ResizeImageUtils.shrink(src, "./images/", 0.6f, 0.3f);    //Shrink the image 0.6*height and 0.3*width


        POIUtils pu = new POIUtils("./data/stories.docx");        //POI
        pu.printText();                                           //Print the text
        pu.printCharCount();                                      //Print the total number of characters
        pu.printParaCount();                                      //Print the total number of paragraphs
        pu.printHierarchy();                                      //Gather the hierarchy of titles & subtitles

        Map<String, String> map = new HashMap<String, String>();  //Replace three string patterns everywhere
        map.put("不在", "牛逼");                                   //they appear in the document
        map.put("道", "不敢说");
        map.put("名", "六加一");
        pu.replace("./data/result.docx", map);

    }
}
